Vue.filter("date2datetime",function (value,format){
	return dateFormat(value,format);
});
Vue.filter("timestamp2datetime",function (value,format){
	return timestampFormat(value,format);
});


var vm  = T.vm = new Vue({
	el:'#webpage',
	data:{
		appearance : {
			showList: true,
			showControllBar : true,
			showSearchForm : false
		},
		q:{
			_keyword:''
		},
		title: null,
		records: {
			filter:{
				sidx : 'id',
				order : 'desc'
			},
			list : [],
			current: 1,
			total: 10,
			pagesize: 10,
			totalPage : 0

		}
	},
	mounted : function(){
		if(T.p("stream_id")){
			this.records.filter['stream_id'] = T.p("stream_id");
		}
		this.getdata();
	},

	methods: {
		getdata : function(){
			var that = this;
			this.records.filter.page = this.records.current;
			var where = jQuery.param(this.records.filter);
			var url = str_format('{0}live/livesnapshot/list?{1}',baseURL,where);
			console.log(url)
			T.loading(true)
			apiget(url).then(function (res) {
				T.loading(false)
				var data = res.page;
				console.log(data);
				that.records.list = data.list;
				that.records.current = data.currPage;
				that.records.pagesize = data.pageSize;
				that.records.total = data.totalCount;
				that.records.totalPage = data.totalPage;

			})
		},
		reload : function (){

		},
		query: function () {

		},
		selectPage : function (page){
			console.log(str_format("当前选择第 {0} 页",page))
			this.records.current = page;
			this.getdata();
		},
		preview : function (row,index,datalist) {
			var data = [];
			$.each(datalist,function (index,v){
				data.push({
					"alt": v.picUrl,
					"pid": v.id, //图片id
					"src": v.picFullUrl, //原图地址
					"thumb": v.picFullUrl //缩略图地址
				})
			});

			console.log(parent.layer.photos)

			layer.photos({
				anim : 5,
				photos : {
					id : '0',
					title : '直播截图',
					"start" : index,
					data : data
				}
			});

		}
	}
});